angular.module('Util',[]);
//css style filter
//use  for make order icon
angular.module('Util').filter('orderClass',function(){
    return function(direction){
        if(direction===-1){
            return "glyphicon-chevron-down";
        }else{
            return "glyphicon-chevron-up";
        }
    };
});

//paging
angular.module('Util').filter('paging',function(){
    return function(items,index,pageSize){
        if(!items) return [];
        var offset=(index-1)*pageSize;
        return items.slice(offset,offset+pageSize);
    }
});

angular.module('Util').filter('size',function(){
    return function(items){
        if (!items)return 0;
        else return items.length || 0;
    };
});
